import { defineStore } from 'pinia';
import { getLocale } from "@/basics/lang";
import { setLanguage } from "@/utils/cookies";
 
interface IAppState {
    language: string
}
 
export const appModule = defineStore({
    id: 'app',
    state(): IAppState{
        return {
            language: getLocale(),
        }
    },
    getters:{},
    actions:{
        setLanguage(language: string) {
            this.language = language
            setLanguage(language)
        },
    }
})